const port = 8085; // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
  devServer: {
    disableHostCheck: true,
    port,
    open: true,
    overlay: {
      warnings: false,
      errors: true,
    },
    proxy: {
      // 只要axios请求中带有/api的url,就会触发代理机制
      "/api": {
        // 目标路径：target(我们要代理请求的地址)
        target: "http://127.0.0.1:8081",
        // 允许跨域
        changOrigin: true,
        // 重写路径 api代替了目标路径
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
};
